package resp

import "github.com/lab-online/pkg/errors"

const (
	CodeSuccess = 20000

	CodeBadRequest = 40000
	CodeValidateError
	CodeAuthError      = 40001
	CodeForbidden      = 40003
	CodeNotFound       = 40004
	CodeBearerTokenErr = 40005

	CodeServerError      = 50000
	CodeSetDeadlineError = 50001
)

var (
	RESTErrBadRequest     = errors.NewRESTError(400, CodeBadRequest, "Bad Request")
	RESTErrValidate       = errors.NewRESTError(400, CodeValidateError, "参数校验失败")
	RESTErrAuth           = errors.NewRESTError(401, CodeAuthError, "Auth 验证失败")
	RESTErrForbidden      = errors.NewRESTError(403, CodeForbidden, "无权限访问")
	RESTErrNotFound       = errors.NewRESTError(404, CodeNotFound, "未找到资源")
	RESTErrBearerTokenErr = errors.NewRESTError(400, CodeBearerTokenErr, "Bearer Token无效")

	RESTErrServer      = errors.NewRESTError(500, CodeServerError, "服务器内部错误")
	RESTErrSetDeadline = errors.NewRESTError(500, CodeSetDeadlineError, "服务端超时重置失败")
)
